"""
脚本说明!

# by bingfeng at 2022-12-17
# 此脚本是BingFengSecGui的配置文件,供CreateSoftware.py生成图形程序时调用.

"""

import os
import platform

# 软件安装目录
software_dir = "/root/pub_work/software/secure"
# 当前工作目录
base_dir = os.getcwd()
# 配置Python解释器路径 python = "D:\pythonProject\\fsafe-venv\python3.7\Scrurl_or_ipts\python.exe"
python = "python3"
# 配置主题 themes_list = ["superhero","purse","yeti","lumen","journal"]
themes = "superhero"
# 每行工具按钮数量
line_count = 4
# 软件界面宽度
width = 900
# 软件界面高度
height = 650
# 按钮宽度
button_width = 20
# 配置工具参数,其中web_protocol,url_or_ip是程序实际启动时调用的变量,format需要添加多余的参数"{}".

tools = {
    "常用工具":{
        "打开软件安装主目录":
            "'xfce4-terminal --tab -T software -x bash -c \"cd {0} ; ls; echo \\\'command<--->: ls {0} \\\' ; exec /usr/bin/bash\"'".format(software_dir),
        "重启todeskd服务":
            "'{0} && echo \" 重启todeskd服务正常 !! \" '".format("systemctl restart todeskd"),
    },
    "信息收集":{
        "打开软件安装主目录":
            "'xfce4-terminal --tab -T software -x bash -c \"cd {0} ; ls; echo \\\'command<--->: ls {0} \\\' ; exec /usr/bin/bash\"'".format(software_dir),
        "waf识别":
            "'xfce4-terminal --tab -T wafw00f -x bash -c \"{0} {{0}}://{{1}}; echo \\\'command<--->: {0} {{0}}://{{1}}\\\' ; exec /usr/bin/bash\"'.format({1}, {2})".
             format("wafw00f", "web_protocol", "url_or_ip"),
        "nmap端口扫描":
            "'xfce4-terminal --tab -T nmap -x bash -c \"{0} {{0}}; echo \\\'command<--->: {0} {{0}}\\\' ; exec /usr/bin/bash\"'.format({1})".format("nmap -sV -sC -p-", "url_or_ip"),
        "masscan端口扫描":
            "'xfce4-terminal --tab -T masscan -x bash -c \"{0} -e {{0}} {{1}}; echo \\\'command<--->: {0} -e {{0}} {{1}}\\\' ; exec /usr/bin/bash\"'.format({1}, {2})".
             format("masscan -p 1-65535 --rate 10000", "eth", "ip"),
        "oneforall子域名扫描":
            "'xfce4-terminal --tab -T oneforall -x bash -c \"{0} {{0}} run; echo \\\'command<--->: {0} {{0}} run\\\' ; exec /usr/bin/bash\"'.format({1})".
             format("python " + software_dir + "/OneForAll/oneforall.py --target", "url_or_ip"),
        "dirsearch目录暴破":
            "'xfce4-terminal --tab -T dirsearch -x bash -c \"{0} {{0}}; echo \\\'command<--->: {0} {{0}}\\\' ; exec /usr/bin/bash\"'.format({1})".
             format("python " + software_dir + "/dirsearch/dirsearch.py -u", "url_or_ip"),
        "whatweb---CMS识别":
            "'xfce4-terminal --tab -T whatweb -x bash -c \"{0} {{0}}; echo \\\'command<--->: {0} {{0}}\\\' ; exec /usr/bin/bash\"'.format({1})".format("whatweb", "url_or_ip"),
    },
    "渗透测试":{
        "打开漏洞利用目录":
            "'xfce4-terminal --tab -T software -x bash -c \"cd {0} ; ls; echo \\\'command<--->: ls {0} \\\' ; exec /usr/bin/bash\"'".format(software_dir),
    },
    "漏洞利用":{
        "打开漏洞利用目录":
            "'xfce4-terminal --tab -T software -x bash -c \"cd {0} ; ls; echo \\\'command<--->: ls {0} \\\' ; exec /usr/bin/bash\"'".format(software_dir),
    },
    "提权专用":{
        "打开漏洞利用目录":
            "'xfce4-terminal --tab -T software -x bash -c \"cd {0} ; ls; echo \\\'command<--->: ls {0} \\\' ; exec /usr/bin/bash\"'".format(software_dir),
    },
    "渗透测试常用命令集合":{
        "打开漏洞利用目录":
            "'xfce4-terminal --tab -T software -x bash -c \"cd {0} ; ls; echo \\\'command<--->: ls {0} \\\' ; exec /usr/bin/bash\"'".format(software_dir),
    },
}

#配置java等环境路径
tools_path = os.getcwd()
if platform.system() == "Windows" :
    #windows系统配置java路径
    java8_path = (tools_path + "\Java_path\jre_1.8_win\\bin\java").replace("\\","\\\\")
    java9_path = (tools_path + "\Java_path\java9_win\\bin\java").replace("\\","\\\\")
else:
    #MacOS和Linux系统配置java路径
    java8_path = tools_path + "/Java_path/java_1.8/bin/java"
    java9_path = tools_path + "/Java_path/java9/bin/java"
